import java.util.*;

/**
 * @author LKQ
 * @date 2022/6/13 17:40
 * @description
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc  = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt(), k = sc.nextInt();
            List<Integer> list = new ArrayList<>();
            for(int i = 0; i < n; i++) {
                int a = sc.nextInt();
                list.add(n);
            }
            Collections.sort(list);
            StringBuffer sb = new StringBuffer();
            for(int i = 0; i < k; i++) {
                sb.append(list.get(i) + " ");
            }
            System.out.println(sb.substring(0, sb.length() - 1));
        }
    }
}
